/*
 * ---------------------------------------------------------------------
 * Copyright (c) 2014, 2015 All Right Reserved
 * This software is developed for study and improve coding skill ...
 *
 * Project:  Excellent Coding< EC >
 *
 * ecMsgProcCQ.h
 * This file for thread message processor with CQueue interface define.
 *
 * Eamil:   epengao@126.com
 * Author:  Peter Gao
 * Version: Intial first version.
 * --------------------------------------------------------------------
 */

#ifndef EC_MSG_PROC_CQ_H
#define EC_MSG_PROC_CQ_H

#include "ecMessageI.h"
#include "ecCQueue.h"
#include "ecBaseType.h"
#include "ecMsgProcI.h"

namespace ec {

class ecMsgProcCQ : public ecMsgProcI
{
public:
    ecMsgProcCQ(EC_U32 nMaxSize);
    virtual ~ecMsgProcCQ();
    virtual void ClearMsg();
    virtual ecMessage* GetMsg();
    virtual EC_U32 PostMsg(ecMessage* pMsg);

protected:
    ecCQueue<ecMessage*> m_cMessageList;
};

} /* namespace ec */
#endif /* EC_MSG_PROC_H */